

#ifndef RUN_LOOKUP_H__
#define RUN_LOOKUP_H__

/*################# An structure element of lookup table ################*/ 
struct run_lookup{
	  gint code;
	  gint  (*func)(void);
};
  
  
/*##################### THE LOOKUP TABLE ##########################*/
  
struct run_lookup run_lookup_table[]={ 
	{0x00, nop_call},		{0x01,lxi_b_16_call},		{0x02,stax_b_call},		{0x03,inx_b_call},
	{0x04,inr_b_call},	{0x05,dcr_b_call}, 		{0x06,mvi_b_8_call}, 		{0x07,rlc_call}, 
	{0x08,code_error_call},{0x09,dad_b_call},		{0x0A,ldax_b_call}, 		{0x0B,dcx_b_call}, 
	{0x0C,inr_c_call},	{0x0D,dcr_c_call}, 		{0x0E,mvi_c_8_call}, 		{0x0F,rrc_call}, 
	{0x10,code_error_call},{0x11,lxi_d_16_call},		{0x12,stax_d_call},		{0x13,inx_d_call},
	{0x14,inr_d_call}, 	{0x15,dcr_d_call}, 		{0x16,mvi_d_8_call}, 		{0x17,ral_call}, 
	{0x18,code_error_call},{0x19,dad_d_call}, 		{0x1A,ldax_d_call}, 		{0x1B,dcx_d_call}, 
	{0x1C,inr_e_call},	{0x1D,dcr_e_call}, 		{0x1E,mvi_e_8_call}, 		{0x1F,rar_call},   
	{0x20,rim_call}, 		{0x21,lxi_h_call}, 		{0x22,shld_16_call}, 		{0x23,inx_h_call},
	{0x24,inr_h_call}, 	{0x25,dcr_h_call}, 		{0x26,mvi_h_8_call}, 		{0x27,daa_call}, 
	{0x28,code_error_call},{0x29,dad_h_call}, 		{0x2A,lhld_16_call}, 		{0x2B,dcx_h_call},
	{0x2C,inr_l_call}, 	{0x2D,dcr_l_call}, 		{0x2E,mvi_l_8_call}, 		{0x2F,cma_call},  
	{0x30,sim_call},		{0x31,lxi_sp_16_call}, 	{0x32,sta_16_call}, 		{0x33,inx_sp_call},
	{0x34,inr_m_call}, 	{0x35,dcr_m_call}, 		{0x36,mvi_m_8_call}, 		{0x37,stc_call},
	{0x38,code_error_call},{0x39,dad_sp_call}, 		{0x3A,lda_16_call}, 		{0x3B,dcx_sp_call},
	{0x3C,inr_a_call}, 	{0x3D,dcr_a_call}, 		{0x3E,mvi_a_8_call},		{0x3F,cmc_call},  
	{0x40,mov_b_b_call},	{0x41,mov_b_c_call}, 		{0x42,mov_b_d_call}, 		{0x43,mov_b_e_call},	
	{0x44,mov_b_h_call}, 	{0x45,mov_b_l_call}, 		{0x46,mov_b_m_call}, 		{0x47,mov_b_a_call},		
	{0x48,mov_c_b_call},	{0x49,mov_c_c_call}, 		{0x4A,mov_c_d_call}, 		{0x4B,mov_c_e_call}, 
	{0x4C,mov_c_h_call}, 	{0x4D,mov_c_l_call}, 		{0x4E,mov_c_m_call},		{0x4F,mov_c_a_call},  
	{0x50,mov_d_b_call}, 	{0x51,mov_d_c_call},		{0x52,mov_d_d_call}, 		{0x53,mov_d_e_call}, 
	{0x54,mov_d_h_call},	{0x55,mov_d_l_call}, 		{0x56,mov_d_m_call},		{0x57,mov_d_a_call},
	{0x58,mov_e_b_call}, 	{0x59,mov_e_c_call}, 		{0x5A,mov_e_d_call}, 		{0x5B,mov_e_e_call},	
	{0x5C,mov_e_h_call}, 	{0x5D,mov_e_l_call}, 		{0x5E,mov_e_m_call},		{0x5F,mov_e_a_call},  	
	{0x60,mov_h_b_call},	{0x61,mov_h_c_call},		{0x62,mov_h_d_call}, 		{0x63,mov_h_e_call}, 
	{0x64,mov_h_h_call}, 	{0x65,mov_h_l_call}, 		{0x66,mov_h_m_call},		{0x67,mov_h_a_call},	
	{0x68,mov_l_b_call}, 	{0x69,mov_l_c_call},		{0x6A,mov_l_d_call}, 		{0x6B,mov_l_e_call}, 	
	{0x6C,mov_l_h_call},	{0x6D,mov_l_l_call}, 		{0x6E,mov_l_m_call},		{0x6F,mov_l_a_call},  
	{0x70,mov_m_b_call},	{0x71,mov_m_c_call}, 		{0x72,mov_m_d_call},		{0x73,mov_m_e_call},	
	{0x74,mov_m_h_call}, 	{0x75,mov_m_l_call},		{0x76,hlt_call}, 			{0x77,mov_m_a_call},	
	{0x78,mov_a_b_call}, 	{0x79,mov_a_c_call}, 		{0x7A,mov_a_d_call}, 		{0x7B,mov_a_e_call}, 
	{0x7C,mov_a_h_call}, 	{0x7D,mov_a_l_call},		{0x7E,mov_a_m_call},		{0x7F,mov_a_a_call},  
	{0x80,add_b_call},	{0x81,add_c_call},		{0x82,add_d_call}, 		{0x83,add_e_call}, 	
	{0x84,add_h_call},	{0x85,add_l_call}, 		{0x86,add_m_call}, 		{0x87,add_a_call},
	{0x88,adc_b_call}, 	{0x89,adc_c_call}, 		{0x8A,adc_d_call}, 		{0x8B,adc_e_call},
	{0x8C,adc_h_call}, 	{0x8D,adc_l_call}, 		{0x8E,adc_m_call},		{0x8F,adc_a_call},  
	{0x90,sub_b_call},	{0x91,sub_c_call}, 		{0x92,sub_d_call}, 		{0x93,sub_e_call}, 
	{0x94,sub_h_call}, 	{0x95,sub_l_call}, 		{0x96,sub_m_call}, 		{0x97,sub_a_call},
	{0x98,sbb_b_call}, 	{0x99,sbb_c_call}, 		{0x9A,sbb_d_call}, 		{0x9B,sbb_e_call},
	{0x9C,sbb_h_call}, 	{0x9D,sbb_l_call}, 		{0x9E,sbb_m_call},		{0x9F,sbb_a_call},  
	{0xA0,ana_b_call},	{0xA1,ana_c_call}, 		{0xA2,ana_d_call}, 		{0xA3,ana_e_call},
	{0xA4,ana_h_call}, 	{0xA5,ana_l_call}, 		{0xA6,ana_m_call}, 		{0xA7,ana_a_call},
	{0xA8,xra_b_call}, 	{0xA9,xra_c_call}, 		{0xAA,xra_d_call}, 		{0xAB,xra_e_call}, 
	{0xAC,xra_h_call}, 	{0xAD,xra_l_call}, 		{0xAE,xra_m_call},		{0xAF,xra_a_call},  
	{0xB0,ora_b_call},	{0xB1,ora_c_call}, 		{0xB2,ora_d_call}, 		{0xB3,ora_e_call}, 
	{0xB4,ora_h_call}, 	{0xB5,ora_l_call}, 		{0xB6,ora_m_call}, 		{0xB7,ora_l_call},
	{0xB8,cmp_b_call}, 	{0xB9,cmp_c_call}, 		{0xBA,cmp_d_call}, 		{0xBB,cmp_e_call},
	{0xBC,cmp_h_call}, 	{0xBD,cmp_l_call}, 		{0xBE,cmp_m_call},		{0xBF,cmp_a_call},  
	{0xC0,rnz_call},		{0xC1,pop_b_call}, 		{0xC2,jnz_16_call}, 		{0xC3,jmp_16_call}, 
	{0xC4,cnz_16_call}, 	{0xC5,push_b_call}, 		{0xC6,adi_8_call}, 		{0xC7,rst_0_call},
	{0xC8,rz_call}, 		{0xC9,ret_call}, 			{0xCA,jz_16_call}, 		{0xCB,code_error_call},
	{0xCC,cz_16_call}, 	{0xCD,call_16_call}, 		{0xCE,aci_8_call},		{0xCF,rst_1_call},  
	{0xD0,rnc_call},		{0xD1,pop_d_call}, 		{0xD2,jnc_16_call}, 		{0xD3,out_8_call}, 
	{0xD4,cnc_16_call}, 	{0xD5,push_d_call}, 		{0xD6,sui_8_call}, 		{0xD7,rst_2_call},
	{0xD8,rc_call}, 		{0xD9,code_error_call},	{0xDA,jc_16_call}, 		{0xDB,in_8_call},
	{0xDC,cc_16_call}, 	{0xDD,code_error_call}, 	{0xDE,sbi_8_call},		{0xDF,rst_3_call},  
	{0xE0,rpo_call},		{0xE1,pop_h_call}, 		{0xE2,jpo_16_call}, 		{0xE3,xthl_call}, 
	{0xE4,cpo_16_call}, 	{0xE5,push_h_call}, 		{0xE6,ani_8_call}, 		{0xE7,rst_4_call},
	{0xE8,rpe_call}, 		{0xE9,pchl_call}, 		{0xEA,jpe_16_call}, 		{0xEB,xchg_call}, 
	{0xEC,cpe_16_call}, 	{0xED,code_error_call}, 	{0xEE,xri_8_call},		{0xEF,rst_5_call},  
	{0xF0,rp_call},		{0xF1,pop_psw_call}, 		{0xF2,jp_16_call}, 		{0xF3,di_call}, 
	{0xF4,cp_16_call}, 	{0xF5,push_psw_call}, 	{0xF6,ori_8_call}, 		{0xF7,rst_6_call},
	{0xF8,rm_call}, 		{0xF9,sphl_call}, 		{0xFA,jm_16_call}, 		{0xFB,ei_call}, 
	{0xFC,cm_16_call}, 	{0xFD,code_error_call},	{0xFE,cpi_8_call},		{0xFF,rst_7_call}
};

#endif /*RUN_LOOKUP_H__*/
